package com.yipingnai.blog.service;

import com.yipingnai.blog.mapper.UserMapper;
import com.yipingnai.blog.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author: jiangym
 * @Date: 2020/5/18 16:24
 */
@Service
public class UserService {
    @Autowired
    UserMapper userMapper;
    public User login(String username, String password) {
        User user = userMapper.login(username, password);
        if(user != null){
            user.setPassword(null);
            return user;
        }
        return null;
    }
}
